package com.treasure.mall.biz.service.core.auction;

import com.treasure.mall.biz.base.SearchableCrudService;
import com.treasure.mall.biz.entity.auction.AuctionBidPO;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/7/16
 */
public interface AuctionBidService extends SearchableCrudService<AuctionBidPO, Long> {
    AuctionBidPO findWinner(Long sessionId);

    List<AuctionBidPO> findLosers(Long sessionId);

    AuctionBidPO findByUserAndSession(Long userId, Long sessionId);

    /**
     * 获得最新的有效出价记录
     *
     * @param sessionId
     * @return
     */
    Page<AuctionBidPO> findBySessionId(Long sessionId, int pageIndex, int pageSize);
}
